{"cells":[{"cell_type":"markdown","metadata":{"graffitiCellId":"id_3a0i46j","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"44C527C86C2941789DE841DE4A782754","mdEditEnable":false},"source":"# 过拟合、欠拟合及其解决方案\n1. 过拟合、欠拟合的概念\n2. 权重衰减\n3. 丢弃法"},{"attachments":{"image.png":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAW8AAAEACAYAAAB8nvebAAAgAElEQVR4Ae2dCfg913jHvyoItTQlDbVEUBVFBG1RrSqtnfCUFq3YqhsSWi3airWbWkJbWlVLheqC2NUS8VhjS6it1VpiCUUQO9U+n/zfNzmZ/9x7597fnZkzc7/neebOzJmzzefMfOe9Z86cI9nVQuAHJB1TS2Fcjp0mcKwkrkc7EzCBJQSOkvQiSf8Xy5KgPmQCgxDIa5Hr8vaD5OhM1iZwvrVjOMI2CFxb0tGS7i3pYpK+K+mASPhnt5HBltI4TdKXtpSWk1lMACv3iMWHBz/yhsgxr8uzJD1D0rMlnTp4aZyhCVRCAHH+WGFpp5VT45q/z3b9E4BzjfXfLBPXbU3GRf814xxMoIUA1vezJH01blysHG4WOxMYmwDXYV6PXJ9cp1yvdiZgAg0C95D0cot3g4p3xyKAeHM9cl3amYAJdCBwxQ5hHMQE+ibg67Bvwk7fBEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABEzABExgEAJ8JNH16zbC5UcVzU+Y8V82FgXh5zgMLSM1lkOalowGqcA9ZJJ12ZYEddl2PK8VjjWPrzp3xlVpXjdteduvMgLfV1l5XJx9BLhJu95Q5c35pAZAbuRF4k36hD9S0jMb8WrafUSMrcG6uTBQUtMh2pxXORpiyagZvqZ9ys44IinGzbKtEm/iNeMuO/ccswReXa+3Zpm8PxKBHIZ0pOyd7QICWI6HSjqp5TjDcnLT4biZLxHDieZQnfjlTdy0wiLaOcfJB5EjPQT8nhmgsnWObtcsVttAXliSpSgRJx9UnCucah0tkfJR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ARxpv++srXwAwIYNXRxzsHEprBKc32FBiznOXVjTNkbHOGX00xZ03TC0MB4M9xhsg9vbDS01rPNR8j7ZRzm/dOVfcsT3Yq43nPEv6WTooxWmgLZ2k6WgewzEthZ/snwu9iEYEeL5+S9MlYs93c/3wz8Snvu9lkyrXnspuACTBD0eWKhbHREfvSLwUeWjTFpKhjyTOwF8LftjCBRrXOlne1VeOCmYAJdCCAwLIsm9z5+2MqsxT0FHheph4cE14w6QUPgqZjKjsmiWgTd+YrpecMY66zLreX+TERxJ4fDBbvZlV53wRMYG4EaA/na+wuX2RfvBBzBD0XXoznNmseAIzqyEBffKWKlpbrcjuP0Vce90xJ94rtjVcW743ROaIJmMAMCTCkLkv13RYZqMbOBEzABExgYgQs3hOrMBd3PwL8nfV43vthscfcCVi8517D8z+/sp/3/M/WZ2gCQcDi7Uth6gTcz3vqNejyb0TALyw3wuZIFRGgG5dn0amoQlyUYQjY8h6Gs3MxARMwga0SsHhvFacTMwETMIFhCFi8h+HsXEzABEygKwGaAZ8Yg60tjGPxXojGB0zABExgFAJ0f72DJD6jZzmmbYLtKQ5MdTVJH5R0dIwgBt08j1wP4TdkXm3n4/z33VfMt8i18JyYCX2fbz/XRDJvrtvqZwi/LMcQebXl4fyhss8li1zjm9u57urHELi4wxui/WJJx0t6AwfLRPcFr//3EEln1F9Ml3BDAt+MeP8niQVXrsttjp1fEgMP5SBBGb4MV263HW/z2yTOttLZJO914qwTNs8p16virjrels4mcbaVziZ5bxJnnfJikFxd0m2IFO5ESYj3s9JjiuJN2ZnZmgFkSojlNmHYX+W36nhbOpvE2VY6Y+adosq51OT4i8lFfVSM/lZT2VwWE9iEwLHR5s34Kk+K65uhbO1MwARMwAQqJnDFVS8rKy67i2YCJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACJmACywlcuzjMkMCMwodjzf46roy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AlD+gg21jfiTByWTI92ctInPKJLGI7RNTEFmgcBjn3EPa1t0iYc+2zTfE18zodykTZivtS5zXspHh80AROokABizYL4IZBlswRiiGXNcQQzreBVp4EIE5f0EE7SRHRTRDlGWqSZebDGERarmocHjrzLMmVTCXER6Wx2If0UeuIRjnMiHGHKNPal7F8TMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETMAETmBaB/wer4vcn5EkwjQAAAABJRU5ErkJggg=="}},"cell_type":"markdown","metadata":{"graffitiCellId":"id_2rrhvg5","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"1C7884059BD2464DB639268E872E99C2","mdEditEnable":false},"source":"# 模型选择、过拟合和欠拟合\n在前几节基于Fashion-MNIST数据集的实验中，我们评价了机器学习模型在训练数据集和测试数据集上的表现。如果你改变过实验中的模型结构或者超参数，你也许发现了：当模型在训练数据集上更准确时，它在测试数据集上却不一定更准确。这是为什么呢？\n## 训练误差和泛化误差\n在解释上述现象之前，我们需要区分训练误差（training error）和泛化误差（generalization error）。通俗来讲，前者指模型在训练数据集上表现出的误差，后者指模型在任意一个测试数据样本上表现出的误差的期望，并常常通过测试数据集上的误差来近似。计算训练误差和泛化误差可以使用之前介绍过的损失函数，例如线性回归用到的平方损失函数和softmax回归用到的交叉熵损失函数。\n\n机器学习模型应关注降低泛化误差。\n\n## 模型选择\n### 验证数据集\n从严格意义上讲，测试集只能在所有超参数和模型参数选定后使用一次。不可以使用测试数据选择模型，如调参。由于无法从训练误差估计泛化误差，因此也不应只依赖训练数据选择模型。鉴于此，我们可以预留一部分在训练数据集和测试数据集以外的数据来进行模型选择。这部分数据被称为验证数据集，简称验证集（validation set）。例如，我们可以从给定的训练集中随机选取一小部分作为验证集，而将剩余部分作为真正的训练集。\n\n### K折交叉验证  \n由于验证数据集不参与模型训练，当训练数据不够用时，预留大量的验证数据显得太奢侈。一种改善的方法是K折交叉验证（K-fold cross-validation）。在K折交叉验证中，我们把原始训练数据集分割成K个不重合的子数据集，然后我们做K次模型训练和验证。每一次，我们使用一个子数据集验证模型，并使用其他K-1个子数据集来训练模型。在这K次训练和验证中，每次用来验证模型的子数据集都不同。最后，我们对这K次训练误差和验证误差分别求平均。\n## 过拟合和欠拟合\n接下来，我们将探究模型训练中经常出现的两类典型问题：\n- 一类是模型无法得到较低的训练误差，我们将这一现象称作欠拟合（underfitting）；\n- 另一类是模型的训练误差远小于它在测试数据集上的误差，我们称该现象为过拟合（overfitting）。\n在实践中，我们要尽可能同时应对欠拟合和过拟合。虽然有很多因素可能导致这两种拟合问题，在这里我们重点讨论两个因素：模型复杂度和训练数据集大小。\n\n### 模型复杂度\n为了解释模型复杂度，我们以多项式函数拟合为例。给定一个由标量数据特征$x$和对应的标量标签$y$组成的训练数据集，多项式函数拟合的目标是找一个$K$阶多项式函数\n\n\n$$\n \\hat{y} = b + \\sum_{k=1}^K x^k w_k \n$$\n\n\n来近似 $y$。在上式中，$w_k$是模型的权重参数，$b$是偏差参数。与线性回归相同，多项式函数拟合也使用平方损失函数。特别地，一阶多项式函数拟合又叫线性函数拟合。\n\n给定训练数据集，模型复杂度和误差之间的关系：\n\n![Image Name](https://cdn.kesci.com/upload/image/q5jc27wxoj.png?imageView2/0/w/960/h/960)\n\n### 训练数据集大小\n影响欠拟合和过拟合的另一个重要因素是训练数据集的大小。一般来说，如果训练数据集中样本数过少，特别是比模型参数数量（按元素计）更少时，过拟合更容易发生。此外，泛化误差不会随训练数据集里样本数量增加而增大。因此，在计算资源允许的范围之内，我们通常希望训练数据集大一些，特别是在模型复杂度较高时，例如层数较多的深度学习模型。\n"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_rxqm2hz","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"662A794758DD42EFA08B79C1EF032C65","mdEditEnable":false},"source":"# 多项式函数拟合实验"},{"cell_type":"code","execution_count":1,"metadata":{"_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","graffitiCellId":"id_yjb9esq","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"F39C60E42E09441D8602243557564E0A","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"1.3.0\n","name":"stdout"}],"source":"%matplotlib inline\nimport torch\nimport numpy as np\nimport sys\nsys.path.append(\"/home/kesci/input\")\nimport d2lzh1981 as d2l\nprint(torch.__version__)"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_1aakii8","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"193FB89ACE2E4D4888FB258A250939AD","mdEditEnable":false},"source":"## 初始化模型参数"},{"cell_type":"code","execution_count":2,"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","graffitiCellId":"id_3xv7jo8","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"9714C0B5EF3344AB89F6C05008E10951","collapsed":false,"scrolled":false},"outputs":[],"source":"n_train, n_test, true_w, true_b = 100, 100, [1.2, -3.4, 5.6], 5\nfeatures = torch.randn((n_train + n_test, 1))\npoly_features = torch.cat((features, torch.pow(features, 2), torch.pow(features, 3)), 1) #三次多项式\nlabels = (true_w[0] * poly_features[:, 0] + true_w[1] * poly_features[:, 1]\n          + true_w[2] * poly_features[:, 2] + true_b)\nlabels += torch.tensor(np.random.normal(0, 0.01, size=labels.size()), dtype=torch.float)"},{"cell_type":"code","execution_count":3,"metadata":{"graffitiCellId":"id_m2mu8wo","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"FDF06E080C72455296FF40E5A03C8A1D","collapsed":false,"scrolled":false},"outputs":[{"output_type":"execute_result","metadata":{},"data":{"text/plain":"(tensor([[-0.8109],\n         [-0.6109]]), tensor([[-0.8109,  0.6576, -0.5333],\n         [-0.6109,  0.3732, -0.2280]]), tensor([-1.1966,  1.7254]))"},"transient":{},"execution_count":3}],"source":"features[:2], poly_features[:2], labels[:2]"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_6fb98pt","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"04AB33FA366C42CDBF58FE28874F3F27","mdEditEnable":false},"source":"## 定义、训练和测试模型"},{"cell_type":"code","execution_count":4,"metadata":{"graffitiCellId":"id_tq07955","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"DD5CB5E380BE4BF498E4F3D5A9F97F43","collapsed":false,"scrolled":false},"outputs":[],"source":"def semilogy(x_vals, y_vals, x_label, y_label, x2_vals=None, y2_vals=None,\n             legend=None, figsize=(3.5, 2.5)):\n    # d2l.set_figsize(figsize)\n    d2l.plt.xlabel(x_label)\n    d2l.plt.ylabel(y_label)\n    d2l.plt.semilogy(x_vals, y_vals)\n    if x2_vals and y2_vals:\n        d2l.plt.semilogy(x2_vals, y2_vals, linestyle=':')\n        d2l.plt.legend(legend)"},{"cell_type":"code","execution_count":5,"metadata":{"graffitiCellId":"id_3lzy7bj","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"3DA4335947C44C018CD2C8B215A641ED","collapsed":false,"scrolled":false},"outputs":[],"source":"num_epochs, loss = 100, torch.nn.MSELoss()\n\ndef fit_and_plot(train_features, test_features, train_labels, test_labels):\n    # 初始化网络模型\n    net = torch.nn.Linear(train_features.shape[-1], 1)\n    # 通过Linear文档可知，pytorch已经将参数初始化了，所以我们这里就不手动初始化了\n    \n    # 设置批量大小\n    batch_size = min(10, train_labels.shape[0])    \n    dataset = torch.utils.data.TensorDataset(train_features, train_labels)      # 设置数据集\n    train_iter = torch.utils.data.DataLoader(dataset, batch_size, shuffle=True) # 设置获取数据方式\n    \n    optimizer = torch.optim.SGD(net.parameters(), lr=0.01)                      # 设置优化函数，使用的是随机梯度下降优化\n    train_ls, test_ls = [], []\n    for _ in range(num_epochs):\n        for X, y in train_iter:                                                 # 取一个批量的数据\n            l = loss(net(X), y.view(-1, 1))                                     # 输入到网络中计算输出，并和标签比较求得损失函数\n            optimizer.zero_grad()                                               # 梯度清零，防止梯度累加干扰优化\n            l.backward()                                                        # 求梯度\n            optimizer.step()                                                    # 迭代优化函数，进行参数优化\n        train_labels = train_labels.view(-1, 1)\n        test_labels = test_labels.view(-1, 1)\n        train_ls.append(loss(net(train_features), train_labels).item())         # 将训练损失保存到train_ls中\n        test_ls.append(loss(net(test_features), test_labels).item())            # 将测试损失保存到test_ls中\n    print('final epoch: train loss', train_ls[-1], 'test loss', test_ls[-1])    \n    semilogy(range(1, num_epochs + 1), train_ls, 'epochs', 'loss',\n             range(1, num_epochs + 1), test_ls, ['train', 'test'])\n    print('weight:', net.weight.data,\n          '\\nbias:', net.bias.data)"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_tvv0n31","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"FEBABF4CE4FC49F8869E557513F6CFD8","mdEditEnable":false},"source":"## 三阶多项式函数拟合（正常）"},{"cell_type":"code","execution_count":6,"metadata":{"graffitiCellId":"id_pc28vr5","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"CD685B472B744329A1CFC47C9F0B5E89","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"final epoch: train loss 0.00010865720105357468 test loss 0.00010689566261135042\nweight: tensor([[ 1.1972, -3.4000,  5.6003]]) \nbias: tensor([4.9995])\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 432x288 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/CD685B472B744329A1CFC47C9F0B5E89/q5mgz8ji1g.png\">"},"transient":{}}],"source":"fit_and_plot(poly_features[:n_train, :], poly_features[n_train:, :], labels[:n_train], labels[n_train:])"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_pu3gps2","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"F5C7FE5EF88D44FE85E0B651B3B09959","mdEditEnable":false},"source":"## 线性函数拟合（欠拟合）"},{"cell_type":"code","execution_count":7,"metadata":{"graffitiCellId":"id_07e409i","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"33AD626DA0B94DB7A28D47697312B45D","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"final epoch: train loss 120.68220520019531 test loss 73.20706939697266\nweight: tensor([[16.6363]]) \nbias: tensor([2.3180])\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 432x288 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/33AD626DA0B94DB7A28D47697312B45D/q5mgzc13z5.png\">"},"transient":{}}],"source":"fit_and_plot(features[:n_train, :], features[n_train:, :], labels[:n_train], labels[n_train:])"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_hmoo3h2","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"BC253732133341DC8F028FB6834C68F0","mdEditEnable":false},"source":"## 训练样本不足（过拟合）"},{"cell_type":"code","execution_count":9,"metadata":{"graffitiCellId":"id_h1gobje","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"AB13F65A70A9484788F8004E427EC290","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"final epoch: train loss 2.0119876861572266 test loss 218.1117706298828\nweight: tensor([[ 0.3743, -0.2475, -0.1371]]) \nbias: tensor([0.4451])\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 432x288 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/AB13F65A70A9484788F8004E427EC290/q5mgzx5uki.png\">"},"transient":{}}],"source":"fit_and_plot(poly_features[0:2, :], poly_features[n_train:, :], labels[0:2], labels[n_train:])"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_4tfoquk","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"A1A8C28C0A204B04AD8B5FFF9C2D2F5B","mdEditEnable":false},"source":"# 权重衰减\n## 方法  \n权重衰减等价于 $L_2$ 范数正则化（regularization）。正则化通过为模型损失函数添加惩罚项使学出的模型参数值较小，是应对过拟合的常用手段。\n\n##  L2 范数正则化（regularization）\n$L_2$范数正则化在模型原损失函数基础上添加$L_2$范数惩罚项，从而得到训练所需要最小化的函数。$L_2$范数惩罚项指的是模型权重参数每个元素的平方和与一个正的常数的乘积。以线性回归中的线性回归损失函数为例\n\n\n$$\n \\ell(w_1, w_2, b) = \\frac{1}{n} \\sum_{i=1}^n \\frac{1}{2}\\left(x_1^{(i)} w_1 + x_2^{(i)} w_2 + b - y^{(i)}\\right)^2 \n$$\n\n\n其中$w_1, w_2$是权重参数，$b$是偏差参数，样本$i$的输入为$x_1^{(i)}, x_2^{(i)}$，标签为$y^{(i)}$，样本数为$n$。将权重参数用向量$\\boldsymbol{w} = [w_1, w_2]$表示，带有$L_2$范数惩罚项的新损失函数为\n\n\n$$\n\\ell(w_1, w_2, b) + \\frac{\\lambda}{2n} |\\boldsymbol{w}|^2,\n$$\n\n\n其中超参数$\\lambda > 0$。当权重参数均为0时，惩罚项最小。当$\\lambda$较大时，惩罚项在损失函数中的比重较大，这通常会使学到的权重参数的元素较接近0。当$\\lambda$设为0时，惩罚项完全不起作用。上式中$L_2$范数平方$|\\boldsymbol{w}|^2$展开后得到$w_1^2 + w_2^2$。\n有了$L_2$范数惩罚项后，在小批量随机梯度下降中，我们将线性回归一节中权重$w_1$和$w_2$的迭代方式更改为\n\n\n$$\n \\begin{aligned} w_1 &\\leftarrow \\left(1- \\frac{\\eta\\lambda}{|\\mathcal{B}|} \\right)w_1 - \\frac{\\eta}{|\\mathcal{B}|} \\sum_{i \\in \\mathcal{B}}x_1^{(i)} \\left(x_1^{(i)} w_1 + x_2^{(i)} w_2 + b - y^{(i)}\\right),\\\\ w_2 &\\leftarrow \\left(1- \\frac{\\eta\\lambda}{|\\mathcal{B}|} \\right)w_2 - \\frac{\\eta}{|\\mathcal{B}|} \\sum_{i \\in \\mathcal{B}}x_2^{(i)} \\left(x_1^{(i)} w_1 + x_2^{(i)} w_2 + b - y^{(i)}\\right). \\end{aligned} \n$$\n\n\n可见，$L_2$范数正则化令权重$w_1$和$w_2$先自乘小于1的数，再减去不含惩罚项的梯度。因此，$L_2$范数正则化又叫权重衰减。权重衰减通过惩罚绝对值较大的模型参数为需要学习的模型增加了限制，这可能对过拟合有效。\n"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_6r7el1m","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"86B363E2493A4A2980C5E00729B925F5","mdEditEnable":false},"source":"## 高维线性回归实验从零开始的实现\n下面，我们以高维线性回归为例来引入一个过拟合问题，并使用权重衰减来应对过拟合。设数据样本特征的维度为$p$。对于训练数据集和测试数据集中特征为$x_1, x_2, \\ldots, x_p$的任一样本，我们使用如下的线性函数来生成该样本的标签：\n\n\n$$\n y = 0.05 + \\sum_{i = 1}^p 0.01x_i + \\epsilon \n$$\n\n\n其中噪声项$\\epsilon$服从均值为0、标准差为0.01的正态分布。为了较容易地观察过拟合，我们考虑高维线性回归问题，如设维度$p=200$；同时，我们特意把训练数据集的样本数设低，如20。"},{"cell_type":"code","execution_count":10,"metadata":{"graffitiCellId":"id_m6mthxc","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"51E803AFA42047D48605A9042CD266F8","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"1.3.0\n","name":"stdout"}],"source":"%matplotlib inline\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport sys\nsys.path.append(\"/home/kesci/input\")\nimport d2lzh1981 as d2l\n\nprint(torch.__version__)"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_d4sywej","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"5AC8DFCEDD734B8289B2CE7D06C82B6F","mdEditEnable":false},"source":"## 初始化模型参数\n与前面观察过拟合和欠拟合现象的时候相似，在这里不再解释。"},{"cell_type":"code","execution_count":11,"metadata":{"graffitiCellId":"id_3ymafxv","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"D66AE4FB939640948F151F6FF7C1740E","collapsed":false,"scrolled":false},"outputs":[],"source":"n_train, n_test, num_inputs = 20, 100, 200\ntrue_w, true_b = torch.ones(num_inputs, 1) * 0.01, 0.05\n\nfeatures = torch.randn((n_train + n_test, num_inputs))\nlabels = torch.matmul(features, true_w) + true_b\nlabels += torch.tensor(np.random.normal(0, 0.01, size=labels.size()), dtype=torch.float)\ntrain_features, test_features = features[:n_train, :], features[n_train:, :]\ntrain_labels, test_labels = labels[:n_train], labels[n_train:]"},{"cell_type":"code","execution_count":12,"metadata":{"graffitiCellId":"id_xd0w3ub","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"E1707F6923A742F69F84896E84B463FE","collapsed":false,"scrolled":false},"outputs":[],"source":"# 定义参数初始化函数，初始化模型参数并且附上梯度\ndef init_params():\n    w = torch.randn((num_inputs, 1), requires_grad=True)\n    b = torch.zeros(1, requires_grad=True)\n    return [w, b]"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_ejz9flm","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"01F0DAF1CD6F48BA92BAAE9F7554EA28","mdEditEnable":false},"source":"## 定义L2范数惩罚项"},{"cell_type":"code","execution_count":13,"metadata":{"graffitiCellId":"id_kkiguji","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"4709112E91504EF68681066730402A03","collapsed":false,"scrolled":false},"outputs":[],"source":"def l2_penalty(w):\n    return (w**2).sum() / 2"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_99qaypt","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"06C980C7C2534A728058234C02210A34","mdEditEnable":false},"source":"## 定义训练和测试"},{"cell_type":"code","execution_count":14,"metadata":{"graffitiCellId":"id_6crgl61","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"3A369C128AE64990854186DAD85DDD7F","collapsed":false,"scrolled":false},"outputs":[],"source":"batch_size, num_epochs, lr = 1, 100, 0.003\nnet, loss = d2l.linreg, d2l.squared_loss\n\ndataset = torch.utils.data.TensorDataset(train_features, train_labels)\ntrain_iter = torch.utils.data.DataLoader(dataset, batch_size, shuffle=True)\n\ndef fit_and_plot(lambd):\n    w, b = init_params()\n    train_ls, test_ls = [], []\n    for _ in range(num_epochs):\n        for X, y in train_iter:\n            # 添加了L2范数惩罚项\n            l = loss(net(X, w, b), y) + lambd * l2_penalty(w)\n            l = l.sum()\n            \n            if w.grad is not None:\n                w.grad.data.zero_()\n                b.grad.data.zero_()\n            l.backward()\n            d2l.sgd([w, b], lr, batch_size)\n        train_ls.append(loss(net(train_features, w, b), train_labels).mean().item())\n        test_ls.append(loss(net(test_features, w, b), test_labels).mean().item())\n    d2l.semilogy(range(1, num_epochs + 1), train_ls, 'epochs', 'loss',\n                 range(1, num_epochs + 1), test_ls, ['train', 'test'])\n    print('L2 norm of w:', w.norm().item())"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_55gl5e9","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"BA54CB5FD4E64380AC1357E8537265DC","mdEditEnable":false},"source":"## 观察过拟合"},{"cell_type":"code","execution_count":15,"metadata":{"graffitiCellId":"id_6pmjf6b","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"C27406AAA0FD41C6801D55ED4B25D5EA","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"L2 norm of w: 13.7647705078125\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 252x180 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/C27406AAA0FD41C6801D55ED4B25D5EA/q5mh6z17eo.svg\">"},"transient":{}}],"source":"fit_and_plot(lambd=0) #lambd=0就是不使用权重衰减,会发生过拟合"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_ejl383l","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"F2335EC469AB402C890CE258932583D1","mdEditEnable":false},"source":"## 使用权重衰减"},{"cell_type":"code","execution_count":16,"metadata":{"graffitiCellId":"id_x1tkbn7","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"0770D8C23B8144C59D13D24390E471F0","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"L2 norm of w: 0.03359941765666008\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 252x180 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/0770D8C23B8144C59D13D24390E471F0/q5mh7m7i1y.svg\">"},"transient":{}}],"source":"fit_and_plot(lambd=3)#lambd设置为3,较大程度地避免了过拟合"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_g2d3ly2","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"FD1464A14A6149AB81CF443A10F843A4","mdEditEnable":false},"source":"## 简洁实现"},{"cell_type":"code","execution_count":18,"metadata":{"graffitiCellId":"id_b6kxfkc","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"20CFA1339D054931892561E254150368","collapsed":false,"scrolled":false},"outputs":[],"source":"def fit_and_plot_pytorch(wd):\n    # 对权重参数衰减。权重名称一般是以weight结尾\n    net = nn.Linear(num_inputs, 1)\n    nn.init.normal_(net.weight, mean=0, std=1)  # 参数初始化使用init模块实现\n    nn.init.normal_(net.bias, mean=0, std=1)\n    optimizer_w = torch.optim.SGD(\n        params=[\n            net.weight],\n        lr=lr,\n        weight_decay=wd)  # 对权重参数衰减\n    optimizer_b = torch.optim.SGD(params=[net.bias], lr=lr)  # 不对偏差参数衰减\n\n    train_ls, test_ls = [], []\n    for _ in range(num_epochs):\n        for X, y in train_iter:\n            l = loss(net(X), y).mean()\n            optimizer_w.zero_grad()\n            optimizer_b.zero_grad()\n\n            l.backward()\n\n            # 对两个optimizer实例分别调用step函数，从而分别更新权重和偏差\n            optimizer_w.step()\n            optimizer_b.step()\n        train_ls.append(loss(net(train_features), train_labels).mean().item())\n        test_ls.append(loss(net(test_features), test_labels).mean().item())\n    d2l.semilogy(range(1, num_epochs + 1), train_ls, 'epochs', 'loss',\n                 range(1, num_epochs + 1), test_ls, ['train', 'test'])\n    print('L2 norm of w:', net.weight.data.norm().item())\n"},{"cell_type":"code","execution_count":20,"metadata":{"graffitiCellId":"id_dxnud8x","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"525D01167F0E40509495588D6B0A0FB9","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"L2 norm of w: 12.493293762207031\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 252x180 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/525D01167F0E40509495588D6B0A0FB9/q5mhcj5zqy.svg\">"},"transient":{}}],"source":"fit_and_plot_pytorch(0) #不使用权重衰减发生的过拟合\n"},{"cell_type":"code","execution_count":21,"metadata":{"graffitiCellId":"id_qclwxdh","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"3FAACA854B9545A8ADADDEB6EE17A680","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"L2 norm of w: 0.04329337924718857\n","name":"stdout"},{"output_type":"display_data","metadata":{"needs_background":"light"},"data":{"text/plain":"<Figure size 252x180 with 1 Axes>","text/html":"<img src=\"https://cdn.kesci.com/rt_upload/3FAACA854B9545A8ADADDEB6EE17A680/q5mhczr8sy.svg\">"},"transient":{}}],"source":"fit_and_plot_pytorch(3) #权重衰减"},{"attachments":{"image.png":{"image/png":"iVBORw0KGgoAAAANSUhEUgAAAVAAAADICAYAAAC+qrlDAAAgAElEQVR4Ae2dB5hVxfn/55a9uzRdKwZRsUQUNZJYULFg1yiKLQkalVjiP5EISYyxJhgVY5pgSeJPjWCJJhpBMQkaC0ZRbBFj74BYUIkoCL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fBRxsU4TQc953+7V5dhil0xmc5PHzxFjU6EYRv1xObDD4rVgDpLd9pvpLoO+wFXxUOp3Zt1Qq9vVKjntSqVS4Xi7VkfQtdVMOVGIJEDChSmzUcjqdWSq30dJB6Cg9nWgjG7mny7Z7xY0tS94hbcLL1YFsnzF/y8TX0D9eQd6NcrQSqBGb6ppIRarSK1FzaaEn7sHfVSAa1UT8Sfms7mT7TEI94P8D7LbGTloLO1gAAAAASUVORK5CYII="}},"cell_type":"markdown","metadata":{"graffitiCellId":"id_c8j5g7h","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"3547FD2B0E60465BB11AA6BADF4AC288","mdEditEnable":false},"source":"# 丢弃法\n\n多层感知机中神经网络图描述了一个单隐藏层的多层感知机。其中输入个数为4，隐藏单元个数为5，且隐藏单元$h_i$（$i=1, \\ldots, 5$）的计算表达式为\n\n\n$$\n h_i = \\phi\\left(x_1 w_{1i} + x_2 w_{2i} + x_3 w_{3i} + x_4 w_{4i} + b_i\\right) \n$$\n\n\n这里$\\phi$是激活函数，$x_1, \\ldots, x_4$是输入，隐藏单元$i$的权重参数为$w_{1i}, \\ldots, w_{4i}$，偏差参数为$b_i$。当对该隐藏层使用丢弃法时，该层的隐藏单元将有一定概率被丢弃掉。设丢弃概率为$p$，那么有$p$的概率$h_i$会被清零，有$1-p$的概率$h_i$会除以$1-p$做拉伸。丢弃概率是丢弃法的超参数。具体来说，设随机变量$\\xi_i$为0和1的概率分别为$p$和$1-p$。使用丢弃法时我们计算新的隐藏单元$h_i'$\n\n\n$$\n h_i' = \\frac{\\xi_i}{1-p} h_i \n$$\n\n\n由于$E(\\xi_i) = 1-p$，因此\n\n\n$$\n E(h_i') = \\frac{E(\\xi_i)}{1-p}h_i = h_i \n$$\n\n\n即丢弃法不改变其输入的期望值。让我们对之前多层感知机的神经网络中的隐藏层使用丢弃法，一种可能的结果如图所示，其中$h_2$和$h_5$被清零。这时输出值的计算不再依赖$h_2$和$h_5$，在反向传播时，与这两个隐藏单元相关的权重的梯度均为0。由于在训练中隐藏层神经元的丢弃是随机的，即$h_1, \\ldots, h_5$都有可能被清零，输出层的计算无法过度依赖$h_1, \\ldots, h_5$中的任一个，从而在训练模型时起到正则化的作用，并可以用来应对过拟合。在测试模型时，我们为了拿到更加确定性的结果，一般不使用丢弃法\n\n![Image Name](https://cdn.kesci.com/upload/image/q5jd69in3m.png?imageView2/0/w/960/h/960)\n"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_698weeu","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"53FBE46C03C040D0A123E957865CEC6A","mdEditEnable":false},"source":"## 丢弃法从零开始的实现"},{"cell_type":"code","execution_count":22,"metadata":{"graffitiCellId":"id_0cw2xsh","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"30FE9592111F415A8C913AC04AD9BF9A","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"1.3.0\n","name":"stdout"}],"source":"%matplotlib inline\nimport torch\nimport torch.nn as nn\nimport numpy as np\nimport sys\nsys.path.append(\"/home/kesci/input\")\nimport d2lzh1981 as d2l\n\nprint(torch.__version__)"},{"cell_type":"code","execution_count":23,"metadata":{"graffitiCellId":"id_7mt4bcl","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"C6790DFD4650485AB8315E04E12D4C74","collapsed":false,"scrolled":false},"outputs":[],"source":"def dropout(X, drop_prob):\n    X = X.float()\n    assert 0 <= drop_prob <= 1\n    keep_prob = 1 - drop_prob\n    # 这种情况下把全部元素都丢弃\n    if keep_prob == 0:\n        return torch.zeros_like(X)\n    mask = (torch.rand(X.shape) < keep_prob).float()\n    \n    return mask * X / keep_prob"},{"cell_type":"code","execution_count":24,"metadata":{"graffitiCellId":"id_ek4ildz","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"F961F801B5CB434683F8F82FD79C8F23","collapsed":false,"scrolled":false},"outputs":[{"output_type":"execute_result","metadata":{},"data":{"text/plain":"tensor([[ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.],\n        [ 8.,  9., 10., 11., 12., 13., 14., 15.]])"},"transient":{},"execution_count":24}],"source":"X = torch.arange(16).view(2, 8)\ndropout(X, 0)"},{"cell_type":"code","execution_count":33,"metadata":{"graffitiCellId":"id_i67qnbo","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"A2563ED1062D48728E6AA868A3A8C3F4","collapsed":false,"scrolled":false},"outputs":[{"output_type":"execute_result","metadata":{},"data":{"text/plain":"tensor([[ 0.,  0.,  4.,  6.,  8.,  0., 12., 14.],\n        [16.,  0.,  0., 22.,  0.,  0., 28.,  0.]])"},"transient":{},"execution_count":33}],"source":"dropout(X, 0.5) #每个值有0.5几率被丢弃,每个值是否被丢弃相互独立,因此每次运行丢弃个数不一致"},{"cell_type":"code","execution_count":34,"metadata":{"graffitiCellId":"id_gwsj0hd","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"56DF0D9E4EE84D04A6CCE5180FF9D164","collapsed":false,"scrolled":false},"outputs":[{"output_type":"execute_result","metadata":{},"data":{"text/plain":"tensor([[0., 0., 0., 0., 0., 0., 0., 0.],\n        [0., 0., 0., 0., 0., 0., 0., 0.]])"},"transient":{},"execution_count":34}],"source":"dropout(X, 1.0)# 100%的几率被丢弃,因此返回全零矩阵"},{"cell_type":"code","execution_count":35,"metadata":{"graffitiCellId":"id_w81sasb","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"E3ECEB59A5F944898BE2C5ABEB513208","collapsed":false,"scrolled":false},"outputs":[],"source":"# 参数的初始化\nnum_inputs, num_outputs, num_hiddens1, num_hiddens2 = 784, 10, 256, 256\n\nW1 = torch.tensor(np.random.normal(0, 0.01, size=(num_inputs, num_hiddens1)), dtype=torch.float, requires_grad=True)\nb1 = torch.zeros(num_hiddens1, requires_grad=True)\nW2 = torch.tensor(np.random.normal(0, 0.01, size=(num_hiddens1, num_hiddens2)), dtype=torch.float, requires_grad=True)\nb2 = torch.zeros(num_hiddens2, requires_grad=True)\nW3 = torch.tensor(np.random.normal(0, 0.01, size=(num_hiddens2, num_outputs)), dtype=torch.float, requires_grad=True)\nb3 = torch.zeros(num_outputs, requires_grad=True)\n\nparams = [W1, b1, W2, b2, W3, b3]"},{"cell_type":"code","execution_count":36,"metadata":{"graffitiCellId":"id_d24i59y","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"C3C7D8DC21FA471AA4AF11DFAC41D7E5","collapsed":false,"scrolled":false},"outputs":[],"source":"drop_prob1, drop_prob2 = 0.2, 0.5\n\ndef net(X, is_training=True):\n    X = X.view(-1, num_inputs)\n    H1 = (torch.matmul(X, W1) + b1).relu()\n    if is_training:  # 只在训练模型时使用丢弃法\n        H1 = dropout(H1, drop_prob1)  # 在第一层全连接后添加丢弃层\n    H2 = (torch.matmul(H1, W2) + b2).relu()\n    if is_training:\n        H2 = dropout(H2, drop_prob2)  # 在第二层全连接后添加丢弃层\n    return torch.matmul(H2, W3) + b3"},{"cell_type":"code","execution_count":37,"metadata":{"graffitiCellId":"id_ticmy78","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"73C1F705FAA14F4390B8D24CCF9E5673","collapsed":false,"scrolled":false},"outputs":[],"source":"def evaluate_accuracy(data_iter, net):\n    acc_sum, n = 0.0, 0\n    for X, y in data_iter:\n        if isinstance(net, torch.nn.Module):\n            net.eval() # 评估模式, 这会关闭dropout\n            acc_sum += (net(X).argmax(dim=1) == y).float().sum().item()\n            net.train() # 改回训练模式\n        else: # 自定义的模型\n            if('is_training' in net.__code__.co_varnames): # 如果有is_training这个参数\n                # 将is_training设置成False\n                acc_sum += (net(X, is_training=False).argmax(dim=1) == y).float().sum().item() \n            else:\n                acc_sum += (net(X).argmax(dim=1) == y).float().sum().item() \n        n += y.shape[0]\n    return acc_sum / n"},{"cell_type":"code","execution_count":38,"metadata":{"graffitiCellId":"id_ryzllq8","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"B493E72017B54831A80790EE0AA3DB2C","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"epoch 1, loss 0.0045, train acc 0.556, test acc 0.759\nepoch 2, loss 0.0023, train acc 0.784, test acc 0.796\nepoch 3, loss 0.0019, train acc 0.822, test acc 0.806\nepoch 4, loss 0.0017, train acc 0.837, test acc 0.830\nepoch 5, loss 0.0016, train acc 0.846, test acc 0.841\n","name":"stdout"}],"source":"num_epochs, lr, batch_size = 5, 100.0, 256  # 这里的学习率设置的很大，原因与之前相同。\nloss = torch.nn.CrossEntropyLoss()\ntrain_iter, test_iter = d2l.load_data_fashion_mnist(batch_size, root='/home/kesci/input/FashionMNIST2065')\nd2l.train_ch3(\n    net,\n    train_iter,\n    test_iter,\n    loss,\n    num_epochs,\n    batch_size,\n    params,\n    lr)\n"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_ar5qzrs","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"99EEA36EC08E471E8EC87F0AF6FCEF34","mdEditEnable":false},"source":"## 简洁实现"},{"cell_type":"code","execution_count":40,"metadata":{"graffitiCellId":"id_t8mnig0","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"28E345EC41EB48D8876B6A15A3E18FBD","collapsed":false,"scrolled":false},"outputs":[],"source":"net = nn.Sequential(\n        d2l.FlattenLayer(),\n        nn.Linear(num_inputs, num_hiddens1),\n        nn.ReLU(),\n        nn.Dropout(drop_prob1),\n        nn.Linear(num_hiddens1, num_hiddens2), \n        nn.ReLU(),\n        nn.Dropout(drop_prob2),\n        nn.Linear(num_hiddens2, 10)\n        )\n\nfor param in net.parameters():\n    nn.init.normal_(param, mean=0, std=0.01)"},{"cell_type":"code","execution_count":41,"metadata":{"graffitiCellId":"id_iba0hj1","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"2EDA1430541148BB863DC9071ED92323","collapsed":false,"scrolled":false},"outputs":[{"output_type":"stream","text":"epoch 1, loss 0.0046, train acc 0.556, test acc 0.761\nepoch 2, loss 0.0023, train acc 0.780, test acc 0.797\nepoch 3, loss 0.0019, train acc 0.823, test acc 0.826\nepoch 4, loss 0.0017, train acc 0.839, test acc 0.791\nepoch 5, loss 0.0016, train acc 0.849, test acc 0.799\n","name":"stdout"}],"source":"optimizer = torch.optim.SGD(net.parameters(), lr=0.5)\nd2l.train_ch3(net, train_iter, test_iter, loss, num_epochs, batch_size, None, None, optimizer)"},{"cell_type":"markdown","metadata":{"graffitiCellId":"id_m2ujou7","jupyter":{},"tags":[],"slideshow":{"slide_type":"slide"},"id":"88258E5A8E1B4FCAA576FB7FB1AAC42C","mdEditEnable":false},"source":"# 总结\n\n- 欠拟合现象：模型无法达到一个较低的误差\n    \n- 过拟合现象：训练误差较低但是泛化误差依然较高，二者相差较大\n"}],"metadata":{"kernelspec":{"name":"python3","display_name":"Python 3","language":"python"},"language_info":{"name":"python","version":"3.7.3","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}